package broadcast;

import java.util.HashSet;
import java.util.Set;

import common.Entity;
import common.Message;


class test {
	public static void main(String[] args) {
		Thread t0 = new Thread() {
			public void run() {
				Entity e1 = new Entity(1, "localhost");
				Entity e2 = new Entity(2, "localhost");
				Entity e3 = new Entity(3, "localhost");
				Entity e4 = new Entity(4, "localhost");
				Entity e5 = new Entity(5, "localhost");
				Set<Entity> entities = new HashSet<Entity>();
				entities.add(e1);
				entities.add(e2);
				entities.add(e3);
				entities.add(e4);
				entities.add(e5);
				BroadcastListener bl = new BroadcastListener() {
					public void onDelivery(Message m) {
						System.out.println(new String(m.getData()));
					}
				};
				Broadcast bc = new Broadcast(bl, entities, 3965, 3966, 3967);
				try {
					sleep(500);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		};
		Thread t1 = new Thread(t0);
	}
}
